package com.workcell.workdata.xthings.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.workcell.workdata.xthings.dto.BindInfoDto;
import com.workcell.workdata.xthings.dto.DeviceBindDto;
import com.workcell.workdata.xthings.entity.CodeChainnum;
import com.workcell.workdata.xthings.entity.DeviceBind;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author Admin
* @description 针对表【t_device_bind(设备绑定表)】的数据库操作Mapper
* @createDate 2023-03-17 18:28:56
* @Entity com.workcell.workdata.xthings.entity.DeviceBind
*/
@Mapper
public interface DeviceBindMapper extends BaseMapper<DeviceBind> {

    List<DeviceBindDto> bindList();

    List<CodeChainnum> deviceBindList(String deviceNo);

    BindInfoDto getBindInfo(@Param("masterDeviceNo") String masterDeviceNo,
                            @Param("addressId") String addressId);

    List<CodeChainnum> bindList2(String chainNum);

    List<DeviceBindDto> allBindList();

    /**
     * 根据设备编码删除绑定关系
     *
     * @param deviceNo 设备编号
     * @return 是否删除成功
     */
    boolean removeByDeviceNo(String deviceNo);

	DeviceBindDto getBindInfoByDeviceNo(@Param("deviceNo") String deviceNo,@Param("queryType") String queryType);
}




